package com.hyl.demo.service;

import cn.hutool.extra.mail.MailUtil;
import com.hyl.demo.constants.MQConstant;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

/**
 * @author leaf
 * @description TODO
 * @created 2023/7/20
 */
@Service
public class ConsumerService {

    /**
     * 工作队列监听：处理
     * @param message
     */
    @RabbitListener(queues = {MQConstant.QUEUE_WORD_NAME})
    public void handlerWorkQueue(Message message){
        System.out.println(new String(message.getBody()));
    }


    /**
     * 工作队列监听：处理
     * @param message
     */
    @RabbitListener(queues = {MQConstant.QUEUE_SUB_DEMO})
    public void handlerSubQueue(Message message){
        System.out.println("demo"+new String(message.getBody()));
    }

}
